package com.fuqi.android.zhongcai.base.view.adapter;


import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.fuqi.android.zhongcai.base.view.fragment.BaseFragment;
import com.fuqi.android.zhongcai.base.view.fragment.HomeFragment;
import com.fuqi.android.zhongcai.base.view.fragment.OrderParentFragment;
import com.fuqi.android.zhongcai.base.view.fragment.UserCenterFragment;

import java.util.ArrayList;
import java.util.List;


public class MainTabAdapter extends FragmentPagerAdapter {

    private List<BaseFragment> fragmentList = new ArrayList<BaseFragment>();;

    public MainTabAdapter(FragmentManager fm) {
        super(fm);
        fragmentList.add(HomeFragment.getInstance());
        fragmentList.add(OrderParentFragment.getInstance());
        fragmentList.add(UserCenterFragment.getInstance());
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

}
